<?php
error_reporting(0);
include ('common/connection.php');
$queryUser="SELECT max(id) as id FROM `users`";
$resultUser=mysql_db_query($db_name,$queryUser);
$rsUser=mysql_fetch_array($resultUser);

$group=$_REQUEST['group'];
$batch=$_REQUEST['batch'];
$gender=$_REQUEST['gender'];
$full_name=$_REQUEST['full_name'];
$nick_name=$_REQUEST['nick_name'];
$cell_phone=$_REQUEST['cell_phone'];
$cell_phone1=$_REQUEST['cell_phone1'];
$email=$_REQUEST['email'];
$address=$_REQUEST['address'];
$amount=$_REQUEST['amount'];
$spouse=$_REQUEST['spouse'];
function generateRandomNumber($ranLength)
{
	$random_id_length = $ranLength; 
	$rnd_id = uniqid(rand(),1); 
	//$rnd_id = md5(uniqid(rand(), true));
	//$rnd_id = strip_tags(stripslashes($rnd_id)); 
	//$rnd_id = str_replace(".","",$rnd_id); 
	$rnd_id = strrev(str_replace("/","",$rnd_id)); 
	$rnd_id = substr($rnd_id,0,$random_id_length);	
	return $rnd_id;
}
$GenerateOrderId=generateRandomNumber("4");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="formStyle.css" type="text/css" />
<link rel="stylesheet" href="tomal_style.css" type="text/css" />
<link rel="stylesheet" href="style_countdown.css" type="text/css" />
<link rel="stylesheet" href="validationEngine.jquery.css" type="text/css"/>
<script src="jquery-1.6.min.js" type="text/javascript"></script>
<script src="jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script>
	jQuery(document).ready( function() {
		// binds form submission and fields to the validation engine
		jQuery("#formID").validationEngine();
	});
</script>
<script language="javascript" type="text/javascript">

function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function getBatch(groupId) {		
		
		var strURL="findState.php?group="+groupId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	function AjaxFunction(email)
	{
		//alert(email);
		var url="validation.php";
		url=url+"?email="+email;
		url=url+"&sid="+Math.random();
		var reqEmqil = getXMLHTTP();
		
		if (reqEmqil) {
			
			reqEmqil.onreadystatechange = function() {
				if (reqEmqil.readyState == 4) {
					// only if "OK"
										
						document.getElementById("msg").innerHTML=reqEmqil.responseText;						
					
				}				
			}			
			reqEmqil.open("GET", url, true);
			reqEmqil.send(null);
		}
	 
	}
	
</script>


<script type="text/javascript" src="jquery.countdown.pack.js"></script>
<script type="text/javascript">
function document_valid(num){

	if(num==1 || num==2){
		document.getElementById("sub_box5").style.display="none";
		document.getElementById("sub_box5_1").style.display="none";
		document.getElementById("sub_box4").style.display="block";
		document.getElementById("sub_box4_1").style.display="block";
	}
	if(num==3){
		document.getElementById("sub_box4").style.display="none";
		document.getElementById("sub_box4_1").style.display="none";
		document.getElementById("sub_box5").style.display="block";
		document.getElementById("sub_box5_1").style.display="block";
	}
	
		
	}
</script>

<script type="text/javascript">
$(function () {
$('#countdown').countdown({until:$.countdown.UTCDate(+6, 2012,  1 - 1, 20), format: 'DHMS', layout: 
	  '<div id="timer">' + '<hr />'+
		  '<div id="timer_days" class="timer_numbers">{dnn}</div>'+
		  '<div id="timer_hours" class="timer_numbers">{hnn}</div>'+ 
		  '<div id="timer_mins" class="timer_numbers">{mnn}</div>'+
		  '<div id="timer_seconds" class="timer_numbers">{snn}</div>'+
		'<div id="timer_labels">'+
			'<div id="timer_days_label" class="timer_labels">days</div>'+
			'<div id="timer_hours_label" class="timer_labels">hours</div>'+
			'<div id="timer_mins_label" class="timer_labels">mins</div>'+
			'<div id="timer_seconds_label" class="timer_labels">secs</div>'+
		'</div>'+							
	'</div>'
						  
});
});
</script>


<title>Home</title>
</head>
<body>
<div id="main_div">
	<form  id="formID" class="formular" name="regis" action="preview.php" method="post">
	<div id="main_div_upper_shadow"></div><!-- end of main_div_upper_shadow-->
    <div id="main_div_upper_black"></div><!-- end of main_div_upper_black-->
    
    <div id="main_div_banner_top">
    	<div id="logo"></div><!-- end of logo -->
    	<div id="header1"></div><!-- end of header1-->
        <div id="slogan"><p>45 years of togetherness</p></div><!-- end of slogan -->
        
    </div><!-- end of main_div_banner_top-->
    
    <div id="middle_black_body">
    	<p class="countdown_header">Times Left for Registration</p>
        <p class="registration_header">Total Registered</p>
		<?php 
			$origi=$rsUser['id']; 
			$total=(100+$origi);
			if($total<1000){$total="0".$total;}			
		?>
        <div class="total_registered"><img src="images/total_registerd.PNG" /><p><?php echo $total;?></p></div>
    
    	<div id="countdown"></div>
    
    
    	<table border="0" cellpadding="0" cellspacing="0">
        	<tr style="color:#FF4B00; font-weight:bold;">
            	<td><p>Date</p></td>
                <td><p>Venue</p></td>
                <td><p>Time</p></td>
            </tr>
            <tr style="color:#FFF">
            	<td><p>27 January, 2012</p></td>
                <td><p>Bangabandhu International Conference Centre</p></td>
                <td><p>3pm - 11pm</p></td>
            </tr>
        </table>
    </div><!-- end of middle_black_body -->
    
    <div id="after_middle_black_body">
   		<div id="after_middle_curvy_top"></div>
        <div id="after_middle_normal_body">
			<div id="blinking_info"><p>NO SPOT REGISTRATION WILL BE AVAILABLE</p></div><!-- end of blinking_info -->
        	<p class="header_p1">Online Registration Form</p>
            <p class="header_p2">Last date submisson 20 January, 2012</p>
            
            <div class="container">
                
                    <table cellspacing="20" cellpadding="10">
                        <tr>
                            <td> Group </td>
                            <td> <select name="group" id="group" onChange="getBatch(this.value)" class="validate[required]">
                                  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($group==1){echo "Selected";}?>>BBA</option>
								  <option value="2"<?php if($group==2){echo "Selected";}?>>MBA</option>
								  <option value="3"<?php if($group==3){echo "Selected";}?>>EMBA</option>
								  <option value="4"<?php if($group==4){echo "Selected";}?>>Fellow</option>
								  <option value="5"<?php if($group==5){echo "Selected";}?>>Honorary</option>
								  <option value="6"<?php if($group==6){echo "Selected";}?>>Associate</option>
								</select>
                                 <br/> <span class="formText">Please Select</span>
                            </td>
                            
                            <td></td><td></td><td></td>
                                
                            <td valign="top"> Batch </td>
                            <td> <div id="statediv" style="position:absolute"><select name="batch" id="batch" class="validate[required]">
										<option>---</option>
											</select></div> 
                                 <br/> <span class="formText">Please Select</span>
                            </td>
                            
                            <td></td><td></td><td></td>
                            
                            <td> Gender </td>
                            <td> <select <select name="gender" id="gender" class="validate[required]">
								  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($_GET['gender']==1){echo "Selected";}?>>Male</option>
								  <option value="2"<?php if($_GET['gender']==2){echo "Selected";}?>>Female</option>
								</select>                                 
                                 <br/> <span class="formText">Please Select</span>
                            </td>
                        </tr>
                        </table>
                        
                        <table cellspacing="20" cellpadding="10">              
                        <tr>
                            <td> Name </td>
                            <td colspan="2">
								<input type="text" class="validate[required] text-input textstyle" name="full_name" id="full_name" size="40" value="<?php echo $_GET['full_name'];?>" />  <br/> 
								<span class="formText">Please Enter Full Name			</span></td>
                                
                            <td> Nickname </td>
                            <td colspan="2"> 
								<input type="text" name="nick_name" class="validate[required] text-input textstyle" id="nick_name" value="<?php echo $_GET['nick_name']?>" /> 
								<br/> <span class="formText">	This Name Will Appear on Your Badge. <br/>Please Keep It in ONE Word.			</span></td>
                        </tr>
                        
                        <tr>
                            <td> Cell No </td>
                            <td colspan="2">
								<input type="text" name="cell_phone" class="validate[required,custom[phone]] text-input textstyle" id="cell_phone" value="<?php echo $_GET['cell_phone'];?>" />   
								<br/> <span class="formText">Please Enter Cell Number.			</span>
							</td>
                                
                            <td> Alternate Cell No. </td>
                            <td colspan="2"> 
								<input type="text" name="cell_phone1" id="cell_phone1" value="<?php echo $_GET['cell_phone1'];?>"  class="textstyle" />  
								<br/> <span class="formText">Alternate Cell Number (if any).			</span></td>
                        </tr>
                        
                        <tr>
                            <td> Email </td>
                            <td colspan="2">
								<input type="text" name="email" id="email" class="validate[required,custom[email]] text-input textstyle" value="<?php echo $_GET['email'];?>" /> 
								<br/> <span class="formText">Please Enter Valid E-mail Address. <br/> Registration Confirmation Will be Sent to This Address			</span> 
							</td>
                                
                            <td> Confirm mail </td>
                            <td colspan="2"> 
								<input class="validate[required,equals[email]] text-input textstyle" type="text" name="conemail" id="conemail" /> 
								<br/> <span class="formText">Re-enter The Same e-mail Address.			</span>
							</td>
                        </tr>
                        
                        <tr>
                            <td valign="top"> Postal Address </td>
                            <td colspan="2">
								<textarea name="address" id="address" class="validate[required] text-input textstyle" style="resize:none;"><?php echo $_GET['address'];?></textarea>
								  <br/> <span class="formText">Please Enter Postal Address.			</span> 
							</td>  
                        </tr>
                	</table>
            </div><!-- end of container -->
            
            
            <div class="box2">
                <h2>Your Registration Options</h2>
                <div class="sub_box1">
                    <h3>Option 1</h3>
                    <div class="sub_box_2">
                        <div class="p_box">IBAAA Life Member</div>
                    </div>
                    <p>This Option is only for Current</p>
                    <p><a href="#">IBAAA Life Members</a></p><br />
                    <div class="sub_box_2">
                        <div class="p_box"><b>BDT 2,000</b></div>
                    </div>
                    <div class="inp">
                    
                    </div>
                </div>
                <div class="sub_box1">
                    <h3>Option 2</h3>
                    <div class="sub_box_2">
                        <div class="p_box">IBAAA Membership + Registration</div>
                    </div>
                    <p>Save 50% on registration</p>
                    <p>and be IBAAA Life Member</p><br />
                    <div class="sub_box_2">
                        <div class="p_box"><b>BDT 4,000</b></div>
                    </div>
                    <div class="inp">
                        
                    
                    </div>
                    
                </div>
                <div class="sub_box1">
                    <h3>Option 3</h3>
                    <div class="sub_box_2">
                        <div class="p_box">Only Registration</div>
                    </div>
                    <p>This Option is for registration</p>
                    <p>For Reunion Only</p><br />
                    <div class="sub_box_2">
                        <div class="p_box"><b>BDT 3,000</b></div>
                    </div>
                    <div class="inp">
                        
                    
                    </div>
                    
                </div>
                        <input align="middle" class="validate[required] radio" style="margin:0 0 0 85px" type="radio" name="amount" id="amount" value="1" <?php if($_GET['amount']==1){echo "checked";}?> >
						Please Select
                        <input align="middle" class="validate[required] radio" style="margin:0 0 0 170px" type="radio" name="amount" id="amount" value="2" <?php if($_GET['amount']==2){echo "checked";}?> >
						Please Select
                        <input align="middle" class="validate[required] radio" style="margin:0 0 0 170px" type="radio" name="amount" id="amount" value="3" <?php if($_GET['amount']==3){echo "checked";}?> >
                        Please Select
               
                <br />
            </div>
            <div class="impt_note" id="blink_1"><p>* IBAAA - IBA Alumni Association. Please Note That IBAAA General Members Will Choose Option 2 Or Option 3.</p></div><br /><br />
            <div class="box3">
                <h2>Are You Bringing Your Spouse Along?</h2>
                <div class="p_box">Spouse Registration Fee (Spouse, Who is an IBA Graduate, is Requested to Register Separately)</div><br /><br />
                <div class="sub_box4" id="sub_box4"><b>BDT 1,500</b>
                </div><div class="p_box1" id="sub_box4_1">With Option 1 & 2</div><br />
                
                <div class="sub_box4" id="sub_box5"><b>BDT 2,500</b></div>
                <div class="p_box1" id="sub_box5_1">With Option 3</div><br />
                
                    <input class="validate[required] radio" align="middle" type="radio" name="spouse" id="spouse" value="1"<?php if($_GET['spouse']==1){echo "Checked";}?>>Yes
                    <input class="validate[required] radio" align="middle" type="radio" type="radio" name="spouse" id="spouse" value="2"<?php if($_GET['spouse']==2){echo "Checked";}?>>No<br /><br />
               
                <div class="p_box" style="font-weight:bold; color:#900;" id="blink_2">GUESTS AND CHILDREN ARE NOT ALLOWED</div>
            	<br /><br />
            
            </div>
            <br />
            <br />
            <div class="box4">
                <br />
                <div class="sub_box6">
					<?php echo $GenerateOrderId;?>
					<input type="hidden" name="uid" id="uid" value="<?php echo $GenerateOrderId;?>" />
				</div><br />
                <div class="p_box_3"><p>Please Enter The Numbers Shown Above in the following Box.</p></div>
					<input type="text" class="validate[required,equals[uid]] text-input textstyle" name="id_no" id="id_no" style="height:30px;" /><br /><br />
                    <input type="submit" value="Submit" class="oxava"/>
                <br />
            </div>	
            
            
            
        
        </div>
        <div id="after_middle_curvy_bottom"></div>
    </div><!-- end of after_middle_black_body -->
    </form>
</div><!-- end of main_div -->

<script type="text/javascript" />
function blink(selector){
$(selector).fadeOut(500, function(){
    $(this).fadeIn(500, function(){
        blink(this);
    });
});
}


/*blink('#blink_1');
blink('#blink_2');*/
blink('#blinking_info');
</script>


</body>
</html>
